var waveObject=function  () {
	
	this.x=[];
	this.y=[];
	this.r=[];
	this.alive=[];
}

waveObject.prototype.num=10;

waveObject.prototype.init=function () {
	
	for (i=0;i<this.num;i++) {
		this.alive[i]=false;
		this.r[i]=0;
	}
}

waveObject.prototype.draw=function () {
	context1.save();
	context1.lineWidth=2;
	context1.shadowBlur=10;
	context1.shadowColor="white";
	
	for (i=0;i<this.num;i++) {
		if(this.alive[i]){
			this.r[i]+=deltaTime*0.05;
			if(this.r[i]>50){
				this.alive[i]=false;
				break;
			}
			var alpha=1-this.r[i]/50;
			
			context1.beginPath();
			context1.arc(this.x[i],this.y[i],this.r[i],0,Math.PI*2);
			context1.closePath();
			
			context1.strokeStyle="rgba(255,255,255,"+alpha+")";
			context1.stroke();
			//draw
		}
	}
	context1.restore();
}

waveObject.prototype.born=function (x,y) {
	
	for (i=0;i<this.num;i++) {
		
		if(!this.alive[i]){
			
			this.alive[i]=true;
			this.r[i]=10;
			this.x[i]=x;
			this.y[i]=y;
			//born
			return;
		}
	}
}



